<template>
  <div class="app-container">
    <nav class="navbar">
      <div class="container">
        <router-link to="/" class="logo">
          <Logo />
          <span class="logo-slogan">探索 AI 的无限可能</span>
        </router-link>
        <div class="nav-links">
          <div class="main-links">
            <router-link to="/" class="nav-link">
              <i class="fas fa-home"></i>
              <span>首页</span>
            </router-link>
            <router-link to="/projects" class="nav-link">
              <i class="fas fa-project-diagram"></i>
              <span>作品集</span>
            </router-link>
            <router-link to="/tools" class="nav-link">
              <i class="fas fa-tools"></i>
              <span>工具</span>
            </router-link>
            <router-link to="/blog" class="nav-link">
              <i class="fas fa-blog"></i>
              <span>随笔</span>
            </router-link>
          </div>
        </div>
      </div>
    </nav>

    <main class="main-content">
      <router-view></router-view>
    </main>

    <footer class="footer">
      <div class="container">
        <div class="footer-content">
          <span>关于我：热爱技术，专注AI领域的开发者</span>
          <span class="divider">|</span>
          <a href="mailto:your.email@example.com">
            <i class="fas fa-envelope"></i>
          </a>
          <span class="divider">|</span>
          <span>&copy; 2024 AiSense</span>
          <span class="divider">|</span>
          <a href="https://beian.miit.gov.cn/" target="_blank">京ICP备2024092917号-1</a>
          <span class="divider">|</span>
          <a href="https://tongji.baidu.com/web/welcome/ico?s=937ed200af3176fd94710eaf610fdba1" target="_blank">
            百度统计
          </a>
        </div>
      </div>
    </footer>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import Logo from '@/components/Logo.vue'

onMounted(() => {
  // 添加百度站长验证 meta 标签
  const meta = document.createElement('meta')
  meta.name = 'baidu-site-verification'
  meta.content = 'codeva-Q0d2qileeX'
  document.head.appendChild(meta)
})
</script>

<style lang="scss">
:root {
  --primary-color: #4F46E5;
  --hover-color: #4338CA;
  --text-color: #1F2937;
  --bg-color: #F9FAFB;
  --border-color: #E5E7EB;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.navbar {
  background: white;
  padding: 0;
  border-bottom: 1px solid var(--border-color);
  height: 70px;
  display: flex;
  align-items: center;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);

  .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    
    .logo-slogan {
      font-size: 0.9rem;
      color: #666;
      border-left: 2px solid #eee;
      padding-left: 12px;
      margin-left: 4px;
    }
  }

  .nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
    height: 100%;

    .main-links {
      display: flex;
      gap: 8px;
      height: 100%;

      .nav-link {
        text-decoration: none;
        color: var(--text-color);
        font-weight: 500;
        padding: 0 16px;
        height: 100%;
        display: flex;
        align-items: center;
        gap: 6px;
        position: relative;
        transition: all 0.3s ease;

        i {
          font-size: 1.1rem;
          opacity: 0.7;
        }

        &::after {
          content: '';
          position: absolute;
          bottom: 0;
          left: 50%;
          transform: translateX(-50%);
          width: 0;
          height: 3px;
          background: var(--primary-color);
          transition: width 0.3s ease;
        }

        &:hover, &.router-link-active {
          color: var(--primary-color);

          &::after {
            width: 100%;
          }
        }
      }
    }
  }
}

.main-content {
  flex: 1;
  margin-top: 70px;
  margin-bottom: 50px;
}

.footer {
  background-color: white;
  padding: 10px 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
  z-index: 1000;

  .footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;

    a {
      color: #666;
      text-decoration: none;
      transition: color 0.3s ease;

      &:hover {
        color: var(--primary-color);
      }
    }

    .divider {
      color: #ddd;
    }
  }
}

@media (max-width: 768px) {
  .navbar {
    .logo-slogan {
      display: none;
    }

    .nav-links {
      .main-links {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 12px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        display: flex;
        justify-content: space-around;
        height: auto;

        .nav-link {
          flex-direction: column;
          padding: 8px 12px;
          font-size: 0.8rem;
          height: auto;

          i {
            font-size: 1.2rem;
          }

          &::after {
            display: none;
          }
        }
      }

      .auth-buttons {
        gap: 8px;

        .btn {
          padding: 6px 12px;
          font-size: 0.9rem;
        }
      }
    }
  }

  .footer {
    .footer-content {
      font-size: 0.8rem;
      gap: 8px;
      padding: 0 10px;
      overflow-x: auto;
      justify-content: flex-start;

      &::-webkit-scrollbar {
        display: none;
      }
    }
  }

  .main-content {
    margin-bottom: 80px;
  }
}
</style> 